# Load GTK
import gtk

# Load our own source code from gtktest.py
# There you can find the main class gtktest()
from MindAge import MindAge

# Load sugar libraries
from sugar.activity import activity  

class MindAgeActivity(activity.Activity):
	def __init__(self, handle):
		activity.Activity.__init__(self, handle)
		self._name = handle

		# Set title for our Activity
		self.set_title('MindAge')

		# Attach sugar toolbox (Share, ...)
		toolbox = activity.ActivityToolbox(self)
		self.set_toolbox(toolbox)
		toolbox.show()

		# Create the main container
		self._main_view = gtk.VBox()

		# Import our class gtktest():

		# Step 1: Load class, which creates gtktest.widget
		self.MindAge = MindAge()

		# Step 2: Remove the widget's parent
		if self.MindAge.widget.parent:
			self.MindAge.widget.parent.remove(self.MindAge.widget)
 
		# Step 3: We attach that widget to our window
		self._main_view.pack_start(self.MindAge.widget)

		# Display everything
		self.MindAge.widget.show()
		self._main_view.show()
		self.set_canvas(self._main_view)
		self.show_all()

